/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task08.task0822;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/* 
N 个数字中的最小值
*/

public class Solution {
    public static void main(String[] args) throws Exception {
        List<Integer> integerList = getIntegerList();
        System.out.println(getMinimum(integerList));
    }

    public static int getMinimum(List<Integer> array) {
        // 此处找出最小值
        int min = Integer.MAX_VALUE;
        for (Integer integer : array) {
            if (integer < min) {
                min = integer;
            }
        }
        return min;
    }

    public static List<Integer> getIntegerList() throws IOException {
        // 此处创建并初始化列表
        ArrayList<Integer> list = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        int count = scanner.nextInt();
        for (int i = 0; i < count; i++) {
            list.add(scanner.nextInt());
        }
        return list;
    }
}
